import request from "../utils/request.js";
export type paginate = {
    page:number
    per_page:number
}
export function getRole(params:paginate){
    return request({
        url: '/role/',
        method: 'get',
        params
    })
}

export function deleteRole(id:number){
    return request({
        url: `/role/${id}`,
        method: 'delete',
    })
}

export function updateEnable(id:number){
    return request({
        url: `/role/enable/${id}`,
        method: 'patch',
    })
}
export function updateRole(params:any,id:number){
    return request({
        url: `/role/${id}`,
        method: 'patch',
        data:params
    })
}
export function createRole(params:any){
    return request({
            url:`/role/`,
            method:'post',
            data:params
    })
}

export function getRoleShow(id:number){
    return request({
        url:`/role/${id}`,
        method:'get',
    })
}
